package com.licq.ldoc.parser.impl.annotation;

import java.lang.annotation.Annotation;

import com.licq.ldoc.domain.Element;
import com.licq.ldoc.domain.Occurrencies;
import com.licq.ldoc.parser.AnnotationParsee;

public class NoSelfReferenceAnnotationParsee extends AnnotationParsee {
	
	public NoSelfReferenceAnnotationParsee(AnnotationParsee successor) {
		super(successor);
	}

	@Override
	protected void doParse(Element element, Annotation annotation) {
		Occurrencies occurrences = element.getOccurrences();
		if (occurrences == Occurrencies.ONLY_ONCE || occurrences == Occurrencies.ZERO_OR_ONCE) {
			element.appendComments(getText());
		}
	}
	
}
